package com.huike.web.controller.contract;

import com.github.xiaoymin.knife4j.spring.extension.ApiAuthorExtension;
import com.huike.business.domain.vo.BusinessTrackVo;
import com.huike.clues.domain.vo.ClueInfoVO;
import com.huike.common.annotation.Log;
import com.huike.common.core.controller.BaseController;
import com.huike.common.core.domain.AjaxResult;
import com.huike.common.core.domain.entity.SysUser;
import com.huike.common.core.page.TableDataInfo;
import com.huike.common.enums.BusinessStatus;
import com.huike.common.enums.BusinessType;
import com.huike.contract.domain.service.RedeployService;
import com.huike.contract.domain.vo.TransferVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description TODO
 * @Author liu
 * @Date 2023-07-12 15:13
 */
@RequestMapping("/transfer")
@RestController
@Api(tags = "转派接口")
@Slf4j
public class RedeployController extends BaseController {

    @Resource
    private RedeployService redeployService;


    @ApiOperation("转派列表接口")
    @PreAuthorize("@ss.hasPermi('system:user:list')")
    @GetMapping("/list")
    public TableDataInfo list(TransferVo user)
    {
        startPage();
        log.info("转派接口:{}",user);
        List<TransferVo> list = redeployService.list(user);
        return getDataTable(list);
    }


    @ApiOperation("转派处理接口")
    @PutMapping("/transfer/assignment/{type}/{userId}/{transferUserId}")
    public AjaxResult transfer(String type,Long userId,Long transferUserId){
        return AjaxResult.success(redeployService.transfer(type,userId,transferUserId));
    }

}
